package ro.prj.manager.svn;

import java.util.List;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class SVNUtil {

    public static List<String> parseNodes(String path){
        List<String> ret=new ArrayList<String>();
        StringTokenizer st=new StringTokenizer(path,"/");
        while(st.hasMoreTokens()){
            String str=st.nextToken();
            if(str!=null&&str.trim().length()>0)
                ret.add(str);
        }
        return ret;
    }

    public static List<String> parseFullNodesToDir(String path){
        List<String> ret=new ArrayList<String>();
        StringTokenizer st=new StringTokenizer(path,"/");
        StringBuffer sb=new StringBuffer();
        while(st.hasMoreTokens()){
            String str=st.nextToken();
            if(str!=null&&str.trim().length()>0){
                sb.append("/").append(str);
                ret.add(sb.toString());
            }
        }
        return ret;
    }


    public static void main(String[] args) {
        System.out.println(parseFullNodesToDir("/unu/doi/trei/patru/cinci"));
    }
}
